﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;
using System.IO;

/// <summary>
/// Summary description for ContentDAO
/// </summary>
public class ContentDAO
{
    private String filePathRoot;

    public ContentDAO(String filePathRoot)
    {
        this.filePathRoot = filePathRoot;
    }

    public String GetContent(String key)
    {
        String path = String.Format("{0}\\{1}.html", this.filePathRoot, key);

        FileStream fileStream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Read);
        StreamReader sr = new StreamReader(fileStream);
        String content = sr.ReadToEnd();
        sr.Close();

        return content;
    }
}